package com.guojian.http.handle;

import java.io.IOException;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;

public class HttpJettyServletResponseWrapper extends HttpServletResponseWrapper {

	private byte[] responseContent;

	public HttpJettyServletResponseWrapper(HttpServletResponse response, byte[] responseContent) {
		super(response);
		this.responseContent = responseContent;
	}

	public byte[] getResponseContent() {
		return responseContent;
	}

	public void setResponseContent(byte[] responseContent) {
		this.responseContent = responseContent;
	}

	public void writeResponse() throws IOException {
		if (responseContent != null) {
			super.getOutputStream().write(getResponseContent());
		}
	}

}
